
;==============================================================================
; rel: defines a relation between entities

; here is a sample: playable-object have coordinates and display-sprite
(relation (have playable-object (and coordinates display-sprite)))

; display-sprite is drawable-object
(relation (is display-sprite drawable-object))


;==============================================================================
; prc: defines a process

; here are:
;   - process' name ('main' process starts first)
;   - the condition what should be executed when a process occurs
;   - actions what should be done
(process main ((is game started) (and (show main-game-menu) (play intro-music))))


(process player-moves-handler ((is left-key pressed) (move player left)))

(process main ((is main-window closed) (return-from-process)))

; calculate roots of square equation
(process-entry
        :name calc-roots-of-square-equations
        :short-name crse
        :args (a b c)
        )

(process csre
    ((is process started) (let d (- (pow b 2) (* 4 a c))))
    ((and (is d initialized) (< d 0)) (return-from-process))
    ((and (is d initialized) (= d 0)) (return-from-process (/ (- b) (* 2 a))))
    ((and (is d initialized) (> d 0)) (return-from-process
                                                (
                                                    (/ (- (- b) d) (* 2 a))
                                                    (/ (+ (- b) d) (* 2 a))
                                                )
                                            )))